package top.yiwyn.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.yiwyn.common.ResultBean;
import top.yiwyn.domain.LogEntity;
import top.yiwyn.mapper.LoggerMapper;

import java.util.List;

/**
 * 时间线功能的控制器。
 */
@RestController
@RequestMapping("/log")
public class LoggerController {

    @Autowired
    LoggerMapper loggerMapper;

    /**
     * 获取关键操作
     *
     * @return
     */
    @GetMapping("/alllog")
    public ResultBean getLog() {
        List<LogEntity> logEntities = loggerMapper.selectData(20);
        return ResultBean.succ("获取成功", logEntities);
    }

}
